package cn.summit.repo;

import java.util.List;

import cn.summit.dto.TradeDTO;
import cn.summit.entity.Product;
import cn.summit.entity.Trade;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * @author summit
 * @since 2021/11/26 16:50
 */
@Repository
public interface TradeRepo extends JpaRepository<Trade, Long>, JpaSpecificationExecutor<Trade>{

	@Query("select t from Trade t")
	 List<Trade> getAll();

	@Query(value = "select t.* from summit.trade t order by id desc", nativeQuery = true)
	List<TradeDTO> getData(String sort);
}
